<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.18"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>embedme: src/SerialPort.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">embedme
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">SerialPort.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_serial_port_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/******************************************************************************</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * This file is part of libemb.</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * libemb is free software: you can redistribute it and/or modify</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * the Free Software Foundation, either version 3 of the License, or</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * (at your option) any later version.</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * libemb is distributed in the hope that it will be useful,</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> * GNU General Public License for more details.</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> * along with libemb.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> * Project: Embedme</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> * Author : FergusZeng</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> * Email  : cblock@126.com</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> * git    : https://gitee.com/newgolo/embedme.git</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> * Copyright 2014~2020 @ ShenZhen ,China</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">*******************************************************************************/</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#ifndef __SERIALPORT_H__</span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#define __SERIALPORT_H__</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160; </div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_i_o_device_8h.html">IODevice.h</a>&quot;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#include &lt;termios.h&gt;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#include &lt;unistd.h&gt;</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160; </div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="keyword">namespace </span>libemb{</div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="_serial_port_8h.html#a3dfa274f1e332bd7d4d15c87e7897330">   39</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="_serial_port_8h.html#a3dfa274f1e332bd7d4d15c87e7897330">BAUDRATE_E</a></div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;{</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    BAUDRATE_1200      = 1200,</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    BAUDRATE_2400      = 2400,</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    BAUDRATE_4800      = 4800,</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;    BAUDRATE_9600      = 9600,</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;    BAUDRATE_19200     = 19200,</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;    BAUDRATE_38400     = 38400,</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    BAUDRATE_57600     = 57600,</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    BAUDRATE_115200    = 115200,</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;    BAUDRATE_460800    = 460800</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;};</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160; </div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="_serial_port_8h.html#ac9d1985d4b11922828cdff21ae71d30d">   56</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="_serial_port_8h.html#ac9d1985d4b11922828cdff21ae71d30d">DATABITS_E</a></div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;{</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    DATABITS_5=5,</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    DATABITS_6,</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    DATABITS_7,</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    DATABITS_8</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;};</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160; </div>
<div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="_serial_port_8h.html#a7ac019369c928a76ff51641dee45d1ee">   68</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="_serial_port_8h.html#a7ac019369c928a76ff51641dee45d1ee">STOPBITS_E</a></div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;{</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    STOPBITS_1=1,</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    STOPBITS_2</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;};</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160; </div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="_serial_port_8h.html#ab23d6577aff534964eaab1b14f8ddf68">   78</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="_serial_port_8h.html#ab23d6577aff534964eaab1b14f8ddf68">PARITY_E</a></div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;{</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    PARITY_NONE=0,</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    PARITY_ODD,</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    PARITY_EVEN,</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    PARITY_SPACE</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;};</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160; </div>
<div class="line"><a name="l00090"></a><span class="lineno"><a class="line" href="_serial_port_8h.html#af20f4af9184ce6643dd695420f570108">   90</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="_serial_port_8h.html#af20f4af9184ce6643dd695420f570108">FLOWCTRL_E</a>{</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    FLOWCTRL_NONE=0,</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    FLOWCTRL_HW,</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    FLOWCTRL_SW</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;};</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160; </div>
<div class="line"><a name="l00100"></a><span class="lineno"><a class="line" href="_serial_port_8h.html#a34383572cf21bca7734b420b533ff7fd">  100</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="_serial_port_8h.html#a34383572cf21bca7734b420b533ff7fd">DATAMODE_E</a>{</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    DATAMODE_RS232=0,   <span class="comment">/* 数字全双工 */</span></div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    DATAMODE_RS422,     <span class="comment">/* 差分全双工 */</span></div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    DATAMODE_RS485,     <span class="comment">/* 差分半双工 */</span></div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;};</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160; </div>
<div class="line"><a name="l00111"></a><span class="lineno"><a class="line" href="_serial_port_8h.html#ae75ec1950cba8a5d377eb0adcdaf1741">  111</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="_serial_port_8h.html#ae75ec1950cba8a5d377eb0adcdaf1741">RS485DIR_E</a>{</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    RS485DIR_RX=0,</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    RS485DIR_TX,</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;};</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160; </div>
<div class="line"><a name="l00120"></a><span class="lineno"><a class="line" href="structlibemb_1_1_serial_port_attr.html">  120</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structlibemb_1_1_serial_port_attr.html">SerialPortAttr</a>{</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    <span class="keywordtype">int</span> m_bandrate;</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    <span class="keywordtype">int</span> m_databits;</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    <span class="keywordtype">int</span> m_stopbits;</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    <span class="keywordtype">int</span> m_parity;</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;    <span class="keywordtype">int</span> m_flowctrl;</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    <span class="keywordtype">int</span> m_datamode;</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    <span class="keywordtype">int</span> m_rs485dir;</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;};</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160; </div>
<div class="line"><a name="l00134"></a><span class="lineno"><a class="line" href="classlibemb_1_1_serial_port.html">  134</a></span>&#160;<span class="keyword">class </span><a class="code" href="classlibemb_1_1_serial_port.html">SerialPort</a>:<span class="keyword">public</span> <a class="code" href="classlibemb_1_1_i_o_device.html">IODevice</a>{</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;<a class="code" href="_base_type_8h.html#a57e803e49526dc5ba8c1915c68708ae0">DECL_CLASSNAME</a>(<a class="code" href="classlibemb_1_1_serial_port.html">SerialPort</a>)</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00141"></a><span class="lineno"><a class="line" href="classlibemb_1_1_serial_port.html#ad11cd7605bc364dedc98b62c0f7dc08c">  141</a></span>&#160;    <span class="keyword">enum</span> <a class="code" href="classlibemb_1_1_serial_port.html#ad11cd7605bc364dedc98b62c0f7dc08c">SERIAL_ATTR_E</a></div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    {</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;        ATTR_BAUDRATE=0,</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;        ATTR_DATABITS,</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;        ATTR_STOPBITS,</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;        ATTR_PARITY,</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;        ATTR_FLOWCTRL,</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;        ATTR_DATAMODE,</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;        ATTR_RS485DIR,</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    };</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;    <a class="code" href="classlibemb_1_1_serial_port.html">SerialPort</a>();</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    <span class="keyword">virtual</span> ~<a class="code" href="classlibemb_1_1_serial_port.html">SerialPort</a>();</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_serial_port.html#a59d3e7f6288084daea9d8da2fcd4d242">open</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* devName,<span class="keywordtype">int</span> ioMode);</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_serial_port.html#ac69b2b253c62d97c63505c8a8da6e695">close</a>();</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classlibemb_1_1_serial_port.html#a901438584faa5f19bf0dd9808db4b974">recvData</a>(<span class="keywordtype">char</span> * buf, <span class="keywordtype">int</span> len, <span class="keywordtype">int</span> usTimeout=-1);</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classlibemb_1_1_serial_port.html#ad26391adcaac564656d72e4f1637fa11">sendData</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *buf, <span class="keywordtype">int</span> len, <span class="keywordtype">int</span> usTimeout=-1);</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classlibemb_1_1_serial_port.html#ad2c215cc8f42ab1cb31bd973fb92f073">setAttribute</a>(<span class="keywordtype">int</span> attr, <span class="keywordtype">int</span> value);</div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classlibemb_1_1_serial_port.html#a5133063ee3cbd3229911a3a7fd506386">getAttribute</a>(<span class="keywordtype">int</span> attr);</div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;    <a class="code" href="structlibemb_1_1_serial_port_attr.html">SerialPortAttr</a> m_attr{BAUDRATE_115200,DATABITS_8,STOPBITS_1,PARITY_NONE,FLOWCTRL_NONE};</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;    uint32 m_errorCount{0};</div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;};</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;}</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160; </div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclasslibemb_1_1_serial_port_html_ad11cd7605bc364dedc98b62c0f7dc08c"><div class="ttname"><a href="classlibemb_1_1_serial_port.html#ad11cd7605bc364dedc98b62c0f7dc08c">libemb::SerialPort::SERIAL_ATTR_E</a></div><div class="ttdeci">SERIAL_ATTR_E</div><div class="ttdoc">串口属性类型</div><div class="ttdef"><b>Definition:</b> SerialPort.h:142</div></div>
<div class="ttc" id="aclasslibemb_1_1_i_o_device_html"><div class="ttname"><a href="classlibemb_1_1_i_o_device.html">libemb::IODevice</a></div><div class="ttdoc">IO设备抽象类</div><div class="ttdef"><b>Definition:</b> IODevice.h:53</div></div>
<div class="ttc" id="astructlibemb_1_1_serial_port_attr_html"><div class="ttname"><a href="structlibemb_1_1_serial_port_attr.html">libemb::SerialPortAttr</a></div><div class="ttdoc">串口属性</div><div class="ttdef"><b>Definition:</b> SerialPort.h:120</div></div>
<div class="ttc" id="aclasslibemb_1_1_serial_port_html_ac69b2b253c62d97c63505c8a8da6e695"><div class="ttname"><a href="classlibemb_1_1_serial_port.html#ac69b2b253c62d97c63505c8a8da6e695">libemb::SerialPort::close</a></div><div class="ttdeci">virtual bool close()</div><div class="ttdoc">关闭串口</div><div class="ttdef"><b>Definition:</b> SerialPort.cpp:232</div></div>
<div class="ttc" id="a_serial_port_8h_html_a7ac019369c928a76ff51641dee45d1ee"><div class="ttname"><a href="_serial_port_8h.html#a7ac019369c928a76ff51641dee45d1ee">libemb::STOPBITS_E</a></div><div class="ttdeci">STOPBITS_E</div><div class="ttdoc">串口停止位</div><div class="ttdef"><b>Definition:</b> SerialPort.h:69</div></div>
<div class="ttc" id="a_serial_port_8h_html_a34383572cf21bca7734b420b533ff7fd"><div class="ttname"><a href="_serial_port_8h.html#a34383572cf21bca7734b420b533ff7fd">libemb::DATAMODE_E</a></div><div class="ttdeci">DATAMODE_E</div><div class="ttdoc">串口模式</div><div class="ttdef"><b>Definition:</b> SerialPort.h:100</div></div>
<div class="ttc" id="aclasslibemb_1_1_serial_port_html"><div class="ttname"><a href="classlibemb_1_1_serial_port.html">libemb::SerialPort</a></div><div class="ttdoc">串口设备类.</div><div class="ttdef"><b>Definition:</b> SerialPort.h:134</div></div>
<div class="ttc" id="a_i_o_device_8h_html"><div class="ttname"><a href="_i_o_device_8h.html">IODevice.h</a></div><div class="ttdoc">输入输出设备</div></div>
<div class="ttc" id="a_serial_port_8h_html_ae75ec1950cba8a5d377eb0adcdaf1741"><div class="ttname"><a href="_serial_port_8h.html#ae75ec1950cba8a5d377eb0adcdaf1741">libemb::RS485DIR_E</a></div><div class="ttdeci">RS485DIR_E</div><div class="ttdoc">RS485方向属性</div><div class="ttdef"><b>Definition:</b> SerialPort.h:111</div></div>
<div class="ttc" id="aclasslibemb_1_1_serial_port_html_ad26391adcaac564656d72e4f1637fa11"><div class="ttname"><a href="classlibemb_1_1_serial_port.html#ad26391adcaac564656d72e4f1637fa11">libemb::SerialPort::sendData</a></div><div class="ttdeci">virtual int sendData(const char *buf, int len, int usTimeout=-1)</div><div class="ttdoc">写串口数据</div><div class="ttdef"><b>Definition:</b> SerialPort.cpp:294</div></div>
<div class="ttc" id="a_serial_port_8h_html_ac9d1985d4b11922828cdff21ae71d30d"><div class="ttname"><a href="_serial_port_8h.html#ac9d1985d4b11922828cdff21ae71d30d">libemb::DATABITS_E</a></div><div class="ttdeci">DATABITS_E</div><div class="ttdoc">串口数据位</div><div class="ttdef"><b>Definition:</b> SerialPort.h:57</div></div>
<div class="ttc" id="aclasslibemb_1_1_serial_port_html_ad2c215cc8f42ab1cb31bd973fb92f073"><div class="ttname"><a href="classlibemb_1_1_serial_port.html#ad2c215cc8f42ab1cb31bd973fb92f073">libemb::SerialPort::setAttribute</a></div><div class="ttdeci">virtual int setAttribute(int attr, int value)</div><div class="ttdoc">设置串口属性</div><div class="ttdef"><b>Definition:</b> SerialPort.cpp:350</div></div>
<div class="ttc" id="a_serial_port_8h_html_a3dfa274f1e332bd7d4d15c87e7897330"><div class="ttname"><a href="_serial_port_8h.html#a3dfa274f1e332bd7d4d15c87e7897330">libemb::BAUDRATE_E</a></div><div class="ttdeci">BAUDRATE_E</div><div class="ttdoc">串口波特率</div><div class="ttdef"><b>Definition:</b> SerialPort.h:40</div></div>
<div class="ttc" id="a_serial_port_8h_html_af20f4af9184ce6643dd695420f570108"><div class="ttname"><a href="_serial_port_8h.html#af20f4af9184ce6643dd695420f570108">libemb::FLOWCTRL_E</a></div><div class="ttdeci">FLOWCTRL_E</div><div class="ttdoc">串口流控位值</div><div class="ttdef"><b>Definition:</b> SerialPort.h:90</div></div>
<div class="ttc" id="aclasslibemb_1_1_serial_port_html_a59d3e7f6288084daea9d8da2fcd4d242"><div class="ttname"><a href="classlibemb_1_1_serial_port.html#a59d3e7f6288084daea9d8da2fcd4d242">libemb::SerialPort::open</a></div><div class="ttdeci">virtual bool open(const char *devName, int ioMode)</div><div class="ttdoc">打开串口</div><div class="ttdef"><b>Definition:</b> SerialPort.cpp:63</div></div>
<div class="ttc" id="a_base_type_8h_html_a57e803e49526dc5ba8c1915c68708ae0"><div class="ttname"><a href="_base_type_8h.html#a57e803e49526dc5ba8c1915c68708ae0">DECL_CLASSNAME</a></div><div class="ttdeci">#define DECL_CLASSNAME(ClassName)</div><div class="ttdef"><b>Definition:</b> BaseType.h:176</div></div>
<div class="ttc" id="a_serial_port_8h_html_ab23d6577aff534964eaab1b14f8ddf68"><div class="ttname"><a href="_serial_port_8h.html#ab23d6577aff534964eaab1b14f8ddf68">libemb::PARITY_E</a></div><div class="ttdeci">PARITY_E</div><div class="ttdoc">串口校验位值</div><div class="ttdef"><b>Definition:</b> SerialPort.h:79</div></div>
<div class="ttc" id="aclasslibemb_1_1_serial_port_html_a901438584faa5f19bf0dd9808db4b974"><div class="ttname"><a href="classlibemb_1_1_serial_port.html#a901438584faa5f19bf0dd9808db4b974">libemb::SerialPort::recvData</a></div><div class="ttdeci">virtual int recvData(char *buf, int len, int usTimeout=-1)</div><div class="ttdoc">读串口数据</div><div class="ttdef"><b>Definition:</b> SerialPort.cpp:237</div></div>
<div class="ttc" id="aclasslibemb_1_1_serial_port_html_a5133063ee3cbd3229911a3a7fd506386"><div class="ttname"><a href="classlibemb_1_1_serial_port.html#a5133063ee3cbd3229911a3a7fd506386">libemb::SerialPort::getAttribute</a></div><div class="ttdeci">virtual int getAttribute(int attr)</div><div class="ttdoc">获取串口属性</div><div class="ttdef"><b>Definition:</b> SerialPort.cpp:463</div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.18
</small></address>
</body>
</html>
